<?php

namespace app\common\validate;

use think\Validate;

class Goods extends Validate
{
    protected $rule = [
        'name'  => 'require',
        'cat_id'  => 'require',
        'amount'   => 'require|integer',
        'img1'   => 'require',
        'poster'   => 'require',
    ];
    protected $message  =   [
        'name.require' => '商品名称不能为空',
        'name.unique' => '商品名称不能重复',
        'cat_id.require'     => '商品分类不能为空',
        'amount.require'     => '库存不能为空',
        'amount.integer'  =>  '商品库存必须是正整数',
        'poster.require'  =>  '商品海报必须上传',
        'img1.require'  =>  '商品图必须上传',
    ];
}
